package cn.edu.fzu.delivery.controller.sys;

import cn.edu.fzu.delivery.common.Result;
import cn.edu.fzu.delivery.domain.entity.Province;
import cn.edu.fzu.delivery.service.ProvinceService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.oas.annotations.EnableOpenApi;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author yifan
 * @date 2022/11/7
 */
@RestController
@RequestMapping("/api/sys/province")
@EnableOpenApi
@Api(tags = "省份管理")
public class ProvinceController {
    @Resource
    private ProvinceService provinceService;

    @GetMapping("/list")
    @ApiOperation(value = "获取省份列表", httpMethod = "GET")
    public Result list() {
        List<Province> provinces = provinceService.list();
        return new Result(provinces);
    }
}
